<?php

/*
|--------------------------------------------------------------------------
| Web Routes
|--------------------------------------------------------------------------
|
| This file is where you may define all of the routes that are handled
| by your application. Just tell Laravel the URIs it should respond
| to using a Closure or controller method. Build something great!
|
*/

//Route::get('/', function () {
//    return view('welcome');
//});

Route::get('login', 'Auth\LoginController@showLoginForm')->name('login');
Route::post('login', 'Auth\LoginController@login');
Route::post('logout', 'Auth\LoginController@logout')->name('logout');

// Registration Routes...
//Route::get('register', 'Auth\RegisterController@showRegistrationForm')->name('register');
//$this->post('register', 'Auth\RegisterController@register');

// Password Reset Routes...
Route::get('password/reset', 'Auth\ForgotPasswordController@showLinkRequestForm');
Route::post('password/email', 'Auth\ForgotPasswordController@sendResetLinkEmail');
Route::get('password/reset/{token}', 'Auth\ResetPasswordController@showResetForm');
Route::post('password/reset', 'Auth\ResetPasswordController@reset');

Route::group(['middleware'=>['web','auth','authCheck']],function(){
    //管理台
    Route::any('admin', ['uses' => 'AdminController@admin']);

    //form 预约功能
    Route::any('admin/formitem', ['uses' => 'AdminController@FormItem']);
    Route::post('admin/formitem/save/{id?}', ['uses' => 'AdminController@FormItemSave']);
    Route::any('admin/formitem/edit/{id}', ['uses' => 'AdminController@FormItemEdit']);
    Route::any('admin/formitem/del/{id}', ['uses' => 'AdminController@FormItemDel']);
    Route::any('admin/form', ['uses' => 'AdminController@Form']);
    Route::any('admin/form/edit/{id}', ['uses' => 'AdminController@FormEdit']);
    Route::any('admin/form/del/{id}', ['uses' => 'AdminController@FormDel']);
    Route::get('admin/form/coupon/{id}/{status}', ['uses' => 'AdminController@FormCoupon']);

    //评论功能
    Route::any('admin/comment', ['uses' => 'AdminController@Comment']);
    Route::any('admin/comment/del/{id}', ['uses' => 'AdminController@CommentDel']);

    //标签功能
    Route::get('admin/tag/{type}', ['uses' => 'AdminController@Tag']);
    Route::get('admin/tag/edit/{id}', ['uses' => 'AdminController@TagEdit']);
    Route::post('admin/tag/save/{id?}', ['uses' => 'AdminController@TagSave']);
    Route::get('admin/tag/del/{id}', ['uses' => 'AdminController@TagDel']);

    //私信功能
    Route::get('admin/message', ['uses' => 'AdminController@Message']);
    Route::get('admin/message/view/{id}', ['uses' => 'AdminController@MessageView']);
    Route::get('admin/message/del/{id}', ['uses' => 'AdminController@MessageDel']);
    Route::get('admin/message/del/{id}/{view}', ['uses' => 'AdminController@MessageDelView']);
    Route::get('admin/message/add', ['uses' => 'AdminController@MessageAdd']);
    Route::post('admin/message/save/{id?}', ['uses' => 'AdminController@MessageSave']);

    //展示功能
    Route::any('admin/post/new', ['uses' => 'AdminController@Post']);
    Route::any('admin/post/edit/{id}', ['uses' => 'AdminController@PostEdit'])->where('id','[0-9]+');
    Route::any('admin/post/save', ['uses' => 'AdminController@PostSave']);
    Route::any('admin/posts', ['uses' => 'AdminController@Posts']);
    Route::any('admin/post/del/{id}', ['uses' => 'AdminController@PostDel']);

    Route::group(['middleware'=>['roleCheck']],function(){
        //用户功能
        Route::any('admin/user/new', ['uses' => 'AdminController@UserAdd']);
        Route::any('admin/user/save', ['uses' => 'AdminController@UserSave']);
        Route::any('admin/users', ['uses' => 'AdminController@Users']);
        Route::any('admin/user/edit/{id}', ['uses' => 'AdminController@UserEdit']);
        Route::any('admin/user/profile', ['uses' => 'AdminController@UserProfile']);
    });

    //服务功能
    Route::any('admin/services', ['uses' => 'AdminController@Services']);
    Route::any('admin/service/new', ['uses' => 'AdminController@Service']);
    Route::any('admin/service/save', ['uses' => 'AdminController@ServiceSave']);
    Route::any('admin/service/del/{id}', ['uses' => 'AdminController@PostDel']);
    Route::any('admin/service/edit/{id}', ['uses' => 'AdminController@ServiceEdit'])->where('id','[0-9]+');

    //活动路演
    Route::any('admin/actives', ['uses' => 'AdminController@Actives']);
    Route::any('admin/active/new', ['uses' => 'AdminController@Active']);
    Route::any('admin/active/save', ['uses' => 'AdminController@ActiveSave']);
    Route::any('admin/active/del/{id}', ['uses' => 'AdminController@PostDel']);
    Route::any('admin/active/edit/{id}', ['uses' => 'AdminController@ActiveEdit'])->where('id','[0-9]+');
    Route::get('admin/shows', ['uses' => 'AdminController@Shows']);
    Route::get('admin/shows/status/{id}', ['uses' => 'AdminController@ShowStatus']);
    Route::get('admin/shows/user/{id}', ['uses' => 'AdminController@ShowsUser']);
    Route::post('admin/shows/user/add', ['uses' => 'AdminController@ShowsUserAdd']);
    Route::get('admin/shows/user/del/{id}', ['uses' => 'AdminController@ShowsUserDel']);
    Route::get('admin/shows/live/{id}', ['uses' => 'AdminController@ShowsLive']);
    Route::get('admin/shows/live/del/{id}', ['uses' => 'AdminController@ShowsLiveDel']);

    //商品
    Route::any('admin/shops', ['uses' => 'AdminController@Shops']);
    Route::any('admin/shops/new', ['uses' => 'AdminController@Shop']);
    Route::any('admin/shops/save', ['uses' => 'AdminController@ShopSave']);
    Route::any('admin/shops/edit/{id}', ['uses' => 'AdminController@ShopEdit']);
    Route::get('admin/shops/del/{id}', ['uses' => 'AdminController@ShopDel']);
    Route::get('admin/cats/', ['uses' => 'AdminController@ShopsCat']);
    Route::post('admin/cats/save', ['uses' => 'AdminController@ShopsCatSave']);
    Route::get('admin/cats/edit/{id}', ['uses' => 'AdminController@ShopsCatEdit']);
    Route::get('admin/cats/del/{id}', ['uses' => 'AdminController@ShopCatDel']);
    Route::get('admin/goods', ['uses' => 'AdminController@ShopGoods']);
    Route::get('admin/goods/new/{id}', ['uses' => 'AdminController@ShopGoodsAdd']);
    Route::post('admin/goods/save', ['uses' => 'AdminController@ShopsGoodsSave']);
    Route::get('admin/goods/edit/{id}', ['uses' => 'AdminController@ShopGoodsEdit']);
    Route::get('admin/goods/del/{id}', ['uses' => 'AdminController@ShopDelEdit']);
    Route::get('admin/coupons', ['uses' => 'AdminController@ShopCoupons']);
    Route::get('admin/coupons/new', ['uses' => 'AdminController@ShopCoupon']);
    Route::post('admin/coupons/save', ['uses' => 'AdminController@ShopCouponSave']);
    Route::get('admin/coupons/edit/{id}', ['uses' => 'AdminController@ShopCouponEdit']);
    Route::get('admin/coupons/del/{id}', ['uses' => 'AdminController@ShopCouponDel']);
    Route::any('admin/create/qr', ['uses' => 'AdminController@CreateQR']);
    Route::get('admin/orders', ['uses' => 'AdminController@GetOrder']);
    Route::get('admin/orders/view/{id}', ['uses' => 'AdminController@OrderView']);
    Route::get('admin/shopcode', ['uses' => 'AdminController@ShopCode']);
    Route::get('admin/shopcode/del/{id}', ['uses' => 'AdminController@ShopCodeDel']);

});

Route::group(['middleware'=>['web','auth','companyCheck']],function (){
    Route::get('company', 'CompanyController@admin');
    Route::get('company/view/{id}', ['uses' => 'CompanyController@FormEdit']);
    Route::get('shop/edit', 'CompanyController@shopEdit');
    Route::post('shop/save', 'CompanyController@shopSave');
    Route::get('coupons', 'CompanyController@ShopCoupons');
    Route::get('coupon', 'CompanyController@ShopCoupon');
    Route::get('coupon/edit/{id}', 'CompanyController@ShopCouponEdit');
    Route::post('coupon/save', 'CompanyController@ShopCouponSave');
    Route::get('coupon/del/{id}', 'CompanyController@ShopCouponDel');
    Route::get('shop/goods', ['uses' => 'CompanyController@ShopGoods']);
    Route::get('shop/goods/new', ['uses' => 'CompanyController@ShopGoodsAdd']);
    Route::post('shop/goods/save', ['uses' => 'CompanyController@ShopsGoodsSave']);
    Route::get('shop/goods/edit/{id}', ['uses' => 'CompanyController@ShopGoodsEdit']);
    Route::get('shop/goods/del/{id}', ['uses' => 'CompanyController@ShopDelEdit']);
    Route::get('shop/cats/', ['uses' => 'CompanyController@ShopsCat']);
    Route::post('shop/cats/save', ['uses' => 'CompanyController@ShopsCatSave']);
    Route::get('shop/cats/edit/{id}', ['uses' => 'CompanyController@ShopsCatEdit']);
    Route::get('shop/cats/del/{id}', ['uses' => 'CompanyController@ShopCatDel']);
    Route::get('shop', ['uses' => 'CompanyController@shop']);
    Route::get('shop/orders/{id}', ['uses' => 'CompanyController@OrderView']);
    Route::get('codes', ['uses' => 'CompanyController@ShopCode']);
});

Route::get('/', 'HomeController@index');
Route::get('wx', 'AdminController@wx');

Route::post('api/xcx/login', 'XcxApi@WxLogin');
Route::post('api/xcx/session', 'XcxApi@GetSession');
Route::post('api/xcx/verifysession', 'XcxApi@verifySession');
Route::post('api/xcx/view', 'XcxApi@GetView');
Route::post('api/xcx/commentpost', 'XcxApi@PostComment');
Route::post('api/xcx/wiget', 'XcxApi@ChangeWiget');
Route::post('api/xcx/comment', 'XcxApi@GetComment');
Route::post('api/xcx/home', 'XcxApi@HomePage');
Route::post('api/xcx/service', 'XcxApi@GetService');
Route::post('api/xcx/keep', 'XcxApi@GetKeep');
Route::post('api/xcx/active', 'XcxApi@GetActive');
Route::post('api/xcx/msg', 'XcxApi@GetMsg');
Route::post('api/xcx/msg/num', 'XcxApi@GetMsgNum');
Route::post('api/xcx/postmsg', 'XcxApi@PostMsg');
Route::get('api/xcx/tag', 'XcxApi@GetTag');
Route::any('api/xcx/postactive', 'XcxApi@PostActive');
Route::any('api/xcx/form', 'XcxApi@GetForm');
Route::any('api/xcx/postform', 'XcxApi@PostForm');
Route::post('api/xcx/level', 'XcxApi@upLevel');
Route::get('excel/export','ExcelController@export');
Route::get('api/xcx/homeservice','XcxApi@HomeService');
Route::post('api/xcx/news','XcxApi@GetNews');
Route::post('api/xcx/sms','XcxApi@SMS');
Route::post('api/xcx/fy','XcxApi@FY');
Route::post('api/xcx/shop', 'XcxApi@GetShop');
Route::post('api/xcx/order', 'XcxApi@GetOrder');
Route::post('api/xcx/post/order', 'XcxApi@PostOrder');
Route::post('api/xcx/post/address', 'XcxApi@PostAddress');
Route::post('api/xcx/post/coupon', 'XcxApi@PostCoupon');
Route::post('api/xcx/get/coupon', 'XcxApi@GetCoupon');
Route::post('api/xcx/order/list', 'XcxApi@UserOrder');
Route::post('api/xcx/del/order', 'XcxApi@DelOrder');
Route::post('api/xcx/pay/success', 'XcxApi@PaySuccess');
Route::any('api/xcx/wxnotify', 'XcxApi@wxnotify');
Route::post('api/xcx/order/shop', 'XcxApi@GetShopOrder');
Route::post('api/xcx/order/meta', 'XcxApi@MetaSuccess');
Route::post('api/xcx/post/live', 'XcxApi@PostLive');
Route::post('api/xcx/live', 'XcxApi@GetLive');
Route::post('api/xcx/user/form', 'XcxApi@UserForm');
Route::post('api/xcx/live/verify', 'XcxApi@liveVerify');
Route::post('api/xcx/verifyform', 'XcxApi@verifyForm');
Route::post('api/xcx/verifycode', 'XcxApi@verifyCode');
Route::post('api/xcx/check', 'YDYLController@check');
Route::post('api/xcx/registermeeting', 'YDYLController@register');
Route::get('api/xcx/getspace', 'WXController@GetSpace');
Route::post('api/xcx/getmeetingroom', 'WXController@GetMeetingRoom');
Route::post('api/xcx/getbigspace', 'WXController@GetBigSpace');
Route::post('api/xcx/getworksite', 'WXController@GetWorkSite');
Route::post('api/xcx/getmeetingroomstatus', 'WXController@GetMeetingRoomStatus');
Route::post('api/xcx/ordermeetingroom', 'WXController@OrderMeetingRoom');
Route::post('api/xcx/orderworksite', 'WXController@OrderWorkSite');
Route::post('api/xcx/orderbigspace', 'WXController@OrderBigSpace');
Route::post('api/xcx/getmeetinglist', 'YDYLController@GetMeetingList');
Route::post('api/xcx/getmeetingdetail', 'YDYLController@GetMeetingDetail');
Route::post('api/xcx/getreport', 'YDYLController@GetReport');
Route::post('api/xcx/getyearreport', 'YDYLController@GetYearReport');
Route::get('api/xcx/getlastreport', 'YDYLController@GetLastReport');
Route::post('api/xcx/volunteer', 'YDYLController@Volunteer');
Route::post('api/xcx/visitor', 'WXController@Visitor');
Route::post('api/xcx/appointment', 'WXController@Appointment');
Route::post('api/xcx/feedback', 'WXController@Feedback');
Route::post('api/xcx/getmyorder', 'WXController@GetMyOrder');
Route::get('api/xcx/getprovidertype', 'WXController@GetProviderType');
Route::post('api/xcx/getproviderlist', 'WXController@GetProviderList');
Route::post('api/xcx/getproviderdetail', 'WXController@GetProviderDetail');
Route::post('api/xcx/registfreeuser', 'WXController@RegistFreeUser');
Route::post('api/xcx/getfreeuser', 'WXController@GetFreeUser');
Route::post('api/xcx/getfreeuserdetail', 'WXController@GetFreeUserDetail');
Route::post('api/xcx/checkfreebill', 'WXController@CheckFreeBill');
Route::post('api/xcx/meetingreg', 'YDYLController@MeetingReg');
Route::post('api/xcx/vipreg', 'YDYLController@VIPReg');
Route::post('api/xcx/mediareg', 'YDYLController@MediaReg');
Route::post('api/xcx/getmymeeting', 'YDYLController@GetMyMeeting');
Route::post('api/xcx/checkticket', 'YDYLController@CheckTicket');
Route::post('api/xcx/getmyprofile', 'WXController@GetMyProfile');
Route::post('api/xcx/setmyprofile', 'WXController@SetMyProfile');
Route::post('api/xcx/postpolicy', 'WXController@PostPolicy');
Route::post('api/xcx/mediareg_new', 'YDYLController@MediaReg_new');
Route::post('api/xcx/vipreg_new', 'YDYLController@VIPReg_new');
Route::post('api/xcx/meetingreg_new', 'YDYLController@MeetingReg_new');
Route::post('api/xcx/stuffreg', 'YDYLController@StuffReg');
